import request from '@/utils/request'

//获取频道
export const artGetChannelsService = () => {
  return request({
    url: '/my/cate/list',
  })
}
//添加分类
export const artAddChannelService = (data) => {
  return request({
    url: '/my/cate/add',
    method: 'post',
    data,
  })
}
//修改分类
export const artEditChannelService = (data) => {
  return request({
    url: '/my/cate/info',
    method: 'put',
    data,
  })
}
//删除分类
export const artDelChannelService = (id) => {
  return request({
    url: '/my/cate/del',
    method: 'delete',
    params: {
      id,
    },
  })
}
//获取文章列表
export const artGetAtricleListService = (params) => {
  return request({
    url: '/my/article/list',
    params,
  })
}
//发布文章
export const artPublishService = (data) => {
  return request({
    url: '/my/article/add',
    method: 'post',
    data,
  })
}
//获取文章详情
export const artGetDetailService = (id) => {
  return request({
    url: '/my/article/info',
    params: {
      id,
    },
  })
}
//编辑文章
export const artEditService = (data) => {
  return request({
    url: '/my/article/info',
    method: 'put',
    data,
  })
}
